<!--#include file="MenuDb.asp"-->
<!--#include file="IncMenu.asp" -->
<br>
<%
EditMenuID=cint(Request("EditMenuID"))
fatherID=int(Request("fatherID"))
msg=trim(request("msg"))
'Modify Record
Action=Trim(request("Action"))
If Action="Mod" And EditMenuID<>"" Then
sql= "SELECT * FROM Nav_Menu WHERE id="&EditMenuID
rs.open sql,conn,3,3
rs("name") =Trim(Request("name"))
rs("enname") =Trim(Request("enname"))
rs("url") =Trim(Request("url"))
rs("fatherID") =trim(Request("fatherID"))
rs("urltarget") =Trim(Request("urltarget"))
rs("comment") =Trim(Request("comment"))
rs("isshow") =Trim(Request("isshow"))
rs("paixu") =Trim(Request("paixu"))
rs.Update
rs.close
msg="EditOK!"
'response.redirect Request.ServerVariables("Http_referer")
'response.redirect "menuadmin.asp"
End If

'Delete Record
If Action="Del" Then
EditMenuID=Int(request("EditMenuID"))
sql= "delete  FROM Nav_Menu WHERE id="&EditMenuID
conn.execute (sql)
'response.redirect Request.ServerVariables("Http_referer")
'response.redirect "menuadmin.asp"
End If

sql="select * from Nav_Menu where ID="&EditMenuID&" order by paixu"
rs.open sql,conn,1,1
if EditMenuID<>0 Then
%>
<TABLE  id='TableMain' border='0' align='center' cellPadding='2' cellSpacing='1' style="BORDER: #cccccc 0px solid;"><!-- 修改 -->
<form method="post" action="?Action=Mod&EditMenuID=<%=int(rs("ID"))%>">
<tr>
<td colspan='2'>
<input type="submit" name="Submit" value="保存修改">
<font color="#ff0000"><u><%=msg%></u></font>

&nbsp;&nbsp;&nbsp;&nbsp;<a href="menuadmin.asp?fatherID=<%=fatherID%>"><b><u>返回菜单管理</u></b></a>
</td>
</tr>
<tr bgcolor="#ddeeff">
<td width='120'>菜单分类：</td>
<td >
<select name="FatherID">
<%'if int(rs("fatherID"))=0 then%>
<option value="0">0.顶级菜单</option>
<%'else%>
<%
    set rs_s = server.createobject("adodb.recordset")
	sql_s= "select * from Nav_Menu where fatherID=0 order by paixu"
	rs_s.open sql_s,conn,3
	if not rs_s.eof then
	 for i=1 to rs_s.recordcount
%>
<option value="<%=trim(rs_s("ID"))%>" <%if int(rs_s("ID"))=int(rs("fatherID")) then%>selected<%end if%>><%=i%>.<%=rs_s("name")%></option>
<%
rs_s.movenext
next
'end if
set rs_s=Nothing
%>

<%end if%>
</select>
</td>
</tr>
<tr>
<td >名称：</td>
<td >
<input type="text" name="name" value="<%=Trim(rs("name"))%>" size='60'>
</td>
</tr>
<tr>
<td >英文名称：</td>
<td >
<input type="text" name="enname" value="<%=Trim(rs("enname"))%>" size='60'>
</td>
</tr>
<tr>
<td >URL：
</td>
<td >
<input type="text" name="url" value="<%=Trim(rs("url"))%>" size='60'>

</td>
</tr>
<tr>
<td >设置：</td>
<td >
<select name="URLTarget">
<option value="<%=Trim(rs("UrlTarget"))%>"><%=Trim(rs("UrlTarget"))%></option>
<option value="FrmMain">FrmMain</option>
<option value="_blank">_blank</option>
<option value="_self">_self</option>
</select>
<select name="isshow">
<option value="<%=Trim(rs("isshow"))%>"><%If Int(rs("isshow"))=1 then%>显示中<%else%>不显示<%End if%></option>
<option value="1">显示中</option>
<option value="0">不显示</option>
</select>
排序
<input type="text" name="paixu" value="<%=Trim(rs("paixu"))%>" size='3'>
</td>
</tr>
	<tr bgcolor='f6f6f6'>
		<td >Comment：</td>
<td ><input type="text" name="Comment" value="<%=Trim(rs("Comment"))%>" size='60'>
</td>
	</tr>
	<tr>
<td colspan='2'><input type="submit" name="Submit" value="保存修改"></td>
</tr>
</form>
</table>
<%else%>
<CENTER>系统无此数据！</CENTER>
<%end if %>


<%
rs.close
%>

<!--#include file="foot.asp" -->